{% load static %}

<div id="comments-list" class="comments">
  <ol class="commentlist">
    {% for comment in comment_list %}
      <li class="comment even thread-even depth-1" id="comment-{{ comment.id }}">
        <div id="div-comment-2570" class="comment-body clearfix">
          <img alt="" src="{% static 'blog/img/comments/girl-03.png' %}" class="avatar avatar-32 photo" height="32" width="32">
          <div class="comment-author vcard">
            <div class="meta">
              <span class="name">{{ comment.name }}</span>
              <span class="date">{{ comment.created_time }}</span></div>
            <div class="comment-text">
              <p>        {{ comment.text|linebreaks }}</p>
            </div>
            <div class="reply">
              <div class="comment-reply-link-wrap" data-original-title="回复" onclick="showCommentReplyForm({{ comment.id }})">
                <a class="comment-reply-link"  itemprop="" >
                  <svg class="bi bi-reply-fill" width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg" style="transform: rotateY(180deg);">
                    <path d="M9.079 11.9l4.568-3.281a.719.719 0 000-1.238L9.079 4.1A.716.716 0 008 4.719V6c-1.5 0-6 0-7 8 2.5-4.5 7-4 7-4v1.281c0 .56.606.898 1.079.62z"></path>
                  </svg>
                </a>
              </div>
            </div>
          </div>
        </div>

          {% if comment.commentreply_set.count != 0 %}
            <ul class="children" style="padding-left: 40px">
                {% for commentReply in comment.commentreply_set.all %}
                <li class="comment byuser comment-author-panda bypostauthor odd alt depth-2">
                    <div id="div-comment-2570" class="comment-body clearfix">

              <img alt="" src="{% static 'blog/img/comments/boy-03.png' %}" class="avatar avatar-32 photo" height="32" width="32">
              <div class="comment-author vcard">
                <div class="meta">
                  <span class="name">{{ commentReply.name }}</span>
                  <span class="date">{{ commentReply.created_time }}</span></div>
                <div class="comment-text">
                  <p>        {{ commentReply.text|linebreaks }}</p>
                </div>
                <div class="reply">
                  <div class="comment-reply-link-wrap" data-original-title="回复" onclick="showCommentReplyForm({{ comment.id }})">
                    <a class="comment-reply-link"  itemprop="" >
                      <svg class="bi bi-reply-fill" width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg" style="transform: rotateY(180deg);">
                        <path d="M9.079 11.9l4.568-3.281a.719.719 0 000-1.238L9.079 4.1A.716.716 0 008 4.719V6c-1.5 0-6 0-7 8 2.5-4.5 7-4 7-4v1.281c0 .56.606.898 1.079.62z"></path>
                      </svg>
                    </a>
                  </div>
                </div>
              </div>
            </div>
                </li>
                {% empty %}
                  暂无评论
                {% endfor %}
            </ul>
          {% else %}
          {% endif %}


      </li>
        <div id="respondComment-{{ comment.id }}" class="comment-respond-child comment-respond clearfix" style="padding-left: 40px"></div>
    {% empty %}
      暂无评论
    {% endfor %}
  </ol>
